package com.baijia.services.impl;

import com.baijia.authentication.principal.Service;
import com.baijia.services.AbstractRegisteredService;

import org.springframework.stereotype.Component;

/**
 * @title RegisteredServiceImpl
 * @desc nothing to say
 * @author caoliang
 * @date 2015年12月5日
 * @version 1.0
 */
@Component
public class RegisteredServiceImpl extends AbstractRegisteredService {

    private static final long serialVersionUID = -5906102762271197627L;

    @Override
    public void setServiceId(final String id) {
        this.serviceId = id;
    }
    @Override
    public boolean matches(final Service service) {
        
        return service != null && service.getId().contains(serviceId);
    }

    @Override
    protected AbstractRegisteredService newInstance() {
        return new RegisteredServiceImpl();
    }

}

